<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>统计a或A的字符串的个数</title>
	</head>
	<body>
		<script>
			var st = ["Amercia","Greece","Britain","Canada","China",",Egypt"];
			var num = 0;
			for(i=0;i<st.length;i++){
				var a = st[i].indexOf("a" || "A");
				if(a != -1){
					num++;
				}
			}
			alert(num);
			
		</script>
	</body>
</html>
